// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  srcDir: "src/",
  devtools: { enabled: false },
  modules: ["nuxt-icons", "@nuxtjs/device",'@pinia-plugin-persistedstate/nuxt','@pinia/nuxt',"nuxt-vite-legacy"],
  legacy:{
    targets:["chrome <= 63"],
    polyfills:[
      "esnext.global-this",
      "es.symbol.match-all",
      "es.string.match-all",
      "es/set",
      "es/map",
      "es/object",
      "es/array"
    ],
    additionalLegacyPolyfills:["regenerator-runtime/runtime"]
  },
  app: {
    head: {
      bodyAttrs: { style: "margin:0;overflow-x:hidden;padding:0;height:100%" },
      meta: [
        // 禁止ios输入框聚焦时放大
        {
          name: "viewport",
          content:
            "initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width, viewport-fit=cover",
        },
        { name: "format-detection", content: "telephone=yes" },
      ],
    },
  },
  devServer: {
    port: 3000,
    host: "0.0.0.0",
  },
  css: [
    "@/assets/css/font.css",
    // '@/assets/css/media.css',
    "@/assets/common.scss",
  ],
  vite: {
    esbuild: {
      drop: ["debugger"],
      pure: [
        "console.log",
        "console.error",
        "console.warn",
        "console.debug",
        "console.trace",
      ],
    },
  },
});
